package cn.gz.coolshark.controller;

import cn.gz.coolshark.mapper.BannerMapper;
import cn.gz.coolshark.pojo.entity.Banner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/banner/")
public class BannerController {
    @Autowired
    private BannerMapper bannerMapper;

    @RequestMapping("select")
    public List<Banner> select(){
        return bannerMapper.select();
    }

    @RequestMapping("delete")
    public void delete(int id){
        bannerMapper.deleteById(id);
    }

    @RequestMapping("/insert")
    public void insert(String url){
        bannerMapper.insert(url);
    }

}
